#!/usr/bin/env python
# encoding: utf-8

print "cwbrowse"

# built-in stuff
import unittest
import sys
sys.path.append("../")
# home made stuff
from scriptgoodies import getTestingEnvironment
# stuff to test
from cwbrowse import *

class CwBrowseTest(unittest.TestCase):
	
	def setUp(self):
		self.env = getTestingEnvironment("cwbrowse.json")
	
	def testRunOne(self):
		self.env["context"]["selection"] = u"http://fr.wikipedia.org/wiki/Arnold_Schönberg"
		main(self.env)
		self.env["context"]["selection"] = u"blah blah\nhttp://fr.wikipedia.org/wiki/Britney_Spears blah blah"
		main(self.env)
	
	def testRunSeveral(self):
		self.env["context"]["selection"] = u"blah blah http://fr.wikipedia.org/wiki/Los_Angeles blah blah http://fr.wikipedia.org/wiki/Vienne_(Autriche)."
		main(self.env)

if __name__ == '__main__':
	unittest.main()


